(function(){

/**
 * 重新包装node.js的文件系统同步部分
 */
sfs = {};
exports.sfs = sfs;
var fs = require("fs");
sfs.rename = fs.renameSync;
sfs.truncate = fs.truncateSync;
sfs.chown = fs.chownSync;
sfs.fchown = fs.fchownSync;
sfs.lchown = fs.lchownSync;
sfs.chmod = fs.chmodSync;
sfs.fchmod = fs.fchmodSync;
sfs.lchmod = fs.lchmodSync;
sfs.stat = fs.statSync;
sfs.lstat = fs.lstatSync;
sfs.fstat = fs.fstatSync;
sfs.link = fs.linkSync;
sfs.symlink = fs.symlinkSync;
sfs.readlink = fs.readlinkSync;
sfs.realpath = fs.realpathSync;
sfs.unlink = fs.unlinkSync;
sfs.rmdir = fs.rmdirSync;
sfs.mkdir = fs.mkdirSync;
sfs.readdir = fs.readdirSync;
sfs.close = fs.closeSync;
sfs.open = fs.openSync;
sfs.utimes = fs.utimesSync;
sfs.futimes = fs.futimesSync;
sfs.fsync = fs.fsyncSync;
sfs.write = fs.writeSync;
sfs.read = fs.readSync;
sfs.readFile = fs.readFileSync;
sfs.writeFile = fs.writeFileSync;

/**
 * 附加的文件函数
 */
file = {};
exports.file = file;
/**
 * 读取UTF-8文本文档为Unicode字符串
 */
function readText(path)
{
	var fin = sfs.open(path,"r");
	var s = sfs.fstat(fin);
	var buf = new Buffer(s.size+1);
	sfs.read(fin,buf,0,s.size,0);
	buf.writeInt8(0,s.size);
	sfs.close(fin);
	return buf.toString();
}
file.readText = readText;

})();